<?php 
   $x = 1+$offset;
      foreach ($journey as $key) {
        echo '<tr class="'.$key->outlet_id.'">';
        echo '<td>'.$x++.'</td>';
        echo '<td>'.$key->outlet_id.'</td>';
        echo '<td>'.$key->outlet_name.'</td>';
        echo '<td>'.$key->address.'</td>';
        // echo '<td></td>';
        // if($key->jc9 == 1 || $key->jc8 == 1 || $key->jc31 == 1)
        //   { echo '<td style="background: #ACE600">Ada</td>'; }
        // else
        //   { echo '<td>Tidak</td>'; }
        if($key->jc == 1)
          { echo '<td> <input type="checkbox" name="journey" class="jc" id="'.$key->outlet_id.'_'.$key->territory_id.'_'.$date[0].$date[1].'_d'.$date[2].'" onchange="simpan(\''.$key->outlet_id.'_'.$key->territory_id.'_'.$date[0].$date[1].'_d'.$date[2].'\')" checked="checked" /></td>';}
        else
          { echo '<td> <input type="checkbox" name="journey" class="jc" id="'.$key->outlet_id.'_'.$key->territory_id.'_'.$date[0].$date[1].'_d'.$date[2].'" onchange="simpan(\''.$key->outlet_id.'_'.$key->territory_id.'_'.$date[0].$date[1].'_d'.$date[2].'\')" /></td>';}
        echo '</tr>';
  }
?>
